<html>
<head><meta charset="utf-8"><title>Dynamic CRT on musl · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html">Dynamic CRT on musl</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226137213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226137213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226137213">(Feb 12 2021 at 13:37)</a>:</h4>
<p>Does something like <code>RUSTFLAGS="-Ctarget-feature=-crt-static -Clinker=musl-gcc" cargo build --release --target x86_64-unknown-linux-musl</code> work for anyone?</p>



<a name="226137617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226137617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226137617">(Feb 12 2021 at 13:41)</a>:</h4>
<p>Looks like the <code>x86_64-alpine-linux-musl</code> target works on Alpine</p>



<a name="226138361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226138361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226138361">(Feb 12 2021 at 13:49)</a>:</h4>
<p>Soo.. Some users have been asking for musl <code>rust-analyzer</code> binaries. We can try to compile it for musl, but it needs <code>dlopen</code>, and AIUI that needs a dynamically linked <code>libc</code> there.</p>



<a name="226138434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226138434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226138434">(Feb 12 2021 at 13:49)</a>:</h4>
<p>I was able to build some code in an Alpine container, but I can't run it on my system (Arch), even though I have a dynamic <code>musl</code> installed</p>



<a name="226138499"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226138499" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226138499">(Feb 12 2021 at 13:50)</a>:</h4>
<p>If rust-analyzer is compiled against musl, all proc macros must also be compiled against musl. You are not allowed to mix two libc in a single process.</p>



<a name="226138528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226138528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226138528">(Feb 12 2021 at 13:50)</a>:</h4>
<p>And probably with a dynamic musl</p>



<a name="226138554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226138554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226138554">(Feb 12 2021 at 13:51)</a>:</h4>
<p>But I think that's the default on Alpine, because <code>-C target-feature=+crt-static</code> fails to link</p>



<a name="226138827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226138827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226138827">(Feb 12 2021 at 13:53)</a>:</h4>
<p>So I guess my questions are:</p>
<ul>
<li>if we ship pre-built Alpine binaries, will people be able to run them on the same Alpine version? (I guess so)</li>
<li>are people actually running Alpine on their computers or dev environments?</li>
<li>what happens on other musl distros like Void Linux? (I guess they won't work?)</li>
</ul>



<a name="226139026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226139026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226139026">(Feb 12 2021 at 13:55)</a>:</h4>
<p>It depends on if musl has a stable abi like glibc or not. If it has, it should also work on Void Linux, otherwise it will only run on the same Alpine version as the one used to build rust-analyzer.</p>



<a name="226139178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226139178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226139178">(Feb 12 2021 at 13:56)</a>:</h4>
<p>Yeah, I posted on <a href="https://github.com/rust-analyzer/rust-analyzer/issues/4956#issuecomment-778210126">https://github.com/rust-analyzer/rust-analyzer/issues/4956#issuecomment-778210126</a></p>



<a name="226139217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226139217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226139217">(Feb 12 2021 at 13:57)</a>:</h4>
<p>Wiki says:</p>
<blockquote>
<p>The dynamic runtime is a single file with stable ABI allowing race-free updates and the static linking support allows an application to be deployed as a single portable binary without significant size overhead.</p>
</blockquote>



<a name="226139611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226139611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226139611">(Feb 12 2021 at 14:01)</a>:</h4>
<p>Nope, my binary is missing <code>libgcc_s</code> on <code>voidlinux-musl</code></p>



<a name="226139809"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226139809" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226139809">(Feb 12 2021 at 14:02)</a>:</h4>
<p><code>libgcc_s</code> is one of the options to use as unwinder.</p>



<a name="226139928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226139928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226139928">(Feb 12 2021 at 14:03)</a>:</h4>
<p>I thought it had some math functions. So it's only used for <code>panic = "abort"</code>?</p>



<a name="226139958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226139958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226139958">(Feb 12 2021 at 14:03)</a>:</h4>
<p>No, it is used for <code>panic = "unwind"</code>.</p>



<a name="226139999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226139999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226139999">(Feb 12 2021 at 14:04)</a>:</h4>
<p>Yeah, sorry, typo</p>



<a name="226140081"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226140081" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226140081">(Feb 12 2021 at 14:04)</a>:</h4>
<p>You could try building libstd with the <code>llvm-libunwind</code> feature enabled.</p>



<a name="226140222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226140222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226140222">(Feb 12 2021 at 14:05)</a>:</h4>
<p>Looks like it's still needed even with <code>panic = "abort"</code>. Not that it would help with RA, of course, since it needs unwinds</p>



<a name="226140595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226140595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226140595">(Feb 12 2021 at 14:08)</a>:</h4>
<p>With <code>panic = "abort"</code>, backtraces are still printed, so the unwinder is still needed.</p>



<a name="226140662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226140662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226140662">(Feb 12 2021 at 14:09)</a>:</h4>
<p>Oh, right</p>



<a name="226141726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226141726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226141726">(Feb 12 2021 at 14:18)</a>:</h4>
<p>Hmm, it seems to work, but I can't confirm that the proc macro server is actually doing something</p>



<a name="226141760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226141760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226141760">(Feb 12 2021 at 14:18)</a>:</h4>
<p>Well, we can ship some binaries and see what users say</p>



<a name="226168970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226168970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226168970">(Feb 12 2021 at 17:30)</a>:</h4>
<p>You should use <code>CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc</code> instead of <code>-C linker=musl-gcc</code> because proc-macros are built for the host and they need host linker.</p>



<a name="226169515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226169515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226169515">(Feb 12 2021 at 17:33)</a>:</h4>
<p>Thanks. That doesn't help in my case, but it's a good thing to keep in mind.</p>



<a name="226169862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226169862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226169862">(Feb 12 2021 at 17:36)</a>:</h4>
<p>What is the error?</p>



<a name="226171457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226171457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226171457">(Feb 12 2021 at 17:47)</a>:</h4>
<p><code>/usr/bin/ld: cannot find -lgcc_s</code></p>



<a name="226171556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226171556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226171556">(Feb 12 2021 at 17:47)</a>:</h4>
<p>This is only on Arch, when compiling for dynamic musl. Compiling on Alpine works.</p>



<a name="226171762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226171762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226171762">(Feb 12 2021 at 17:48)</a>:</h4>
<p>I do have a <code>libgcc_s</code> somewhere, but it's probably not picking it up</p>



<a name="226173208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226173208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226173208">(Feb 12 2021 at 17:56)</a>:</h4>
<p>Ah, you need unwinder for musl. It's often not build unless you obtain full musl toolchain like this one: <a href="https://github.com/richfelker/musl-cross-make">https://github.com/richfelker/musl-cross-make</a><br>
It doesn't pick <code>libgcc_s</code> from your system because it's compiled for glibc.</p>



<a name="226173525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226173525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226173525">(Feb 12 2021 at 17:58)</a>:</h4>
<p>Hmm. So if I do that, which <code>libgcc_s</code> will it pick?</p>



<a name="226173640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226173640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226173640">(Feb 12 2021 at 17:59)</a>:</h4>
<p>I mean, people have been asking specifically for Alpine builds, and there's a usable <code>libgcc_s</code>, so I'm tempted to build it in an Alpine container and call it a day.</p>



<a name="226173781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226173781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226173781">(Feb 12 2021 at 18:00)</a>:</h4>
<p>Otherwise I'm not sure if dynamic executables using <code>musl</code> and <code>libgcc_s</code> are actually going to be portable enough to be useful for anyone</p>



<a name="226178319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226178319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226178319">(Feb 12 2021 at 18:37)</a>:</h4>
<p>unwinder like <code>libgcc_s</code> is tied to the compiler, your system gcc will always pick unwinder for glibc<br>
if you install full musl toolchain it will use its own <code>libgcc_s</code></p>



<a name="226185409"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226185409" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226185409">(Feb 12 2021 at 19:39)</a>:</h4>
<p>Yeah, but the executable will link it dynamically, so it's hard to distribute. At least harder than distributing one that only links to musl. E.g. Void seems to have musl, but not libgcc_s</p>



<a name="226199646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226199646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariadne Conill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226199646">(Feb 12 2021 at 21:40)</a>:</h4>
<p>they should be.  alpine does not really make any changes to musl</p>



<a name="226200458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226200458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226200458">(Feb 12 2021 at 21:48)</a>:</h4>
<p>My binaries built on Alpine don't work on my Arch system (nor on Void/musl), and I can't easily build them the other way around. So it still seems finicky.</p>



<a name="226213327"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226213327" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariadne Conill <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226213327">(Feb 13 2021 at 00:03)</a>:</h4>
<p>Strange.  They should work on Void/musl.  We do link to libc dynamically, like on glibc though.</p>



<a name="226220397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Dynamic%20CRT%20on%20musl/near/226220397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl.html#226220397">(Feb 13 2021 at 02:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="203546">Laurențiu Nicola</span> <a href="#narrow/stream/131828-t-compiler/topic/Dynamic.20CRT.20on.20musl/near/226200458">said</a>:</p>
<blockquote>
<p>My binaries built on Alpine don't work on my Arch system (nor on Void/musl), and I can't easily build them the other way around. So it still seems finicky.</p>
</blockquote>
<p>If the binary is dynamically linked to libgcc_s it won't work on Arch because you don't have libgcc_s for musl. You only have libgcc_s linked to glibc that cannot be used with musl. <br>
On Alpine (no clue about Void) containers libgcc_s is not installed by the default and you have to install it manually (using package manager), maybe the same applies to Void. If toolchain version on Alpine isn't much newer than on Void the binary should work.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>